<?php

declare(strict_types=1);

namespace App\Common\Service\Affiliate;

class TaoBaoService extends AbstractAffiliateService
{
    public function getAuthUrl(array $params): string
    {
        $domain = $this->getDomain();
        $callBackUrl = hyperf_url("callback/loginCallback/uid/{uid}/main_uid/{main_uid}/suc_jump/{suc_jump}/type/{type}",[
            'uid' => $params['uid'],
            'main_uid' => $params['main_uid'],
            'suc_jump' => urlencode($params['url']),
            'type' => $params['type'],
        ],$domain);

        $urls = "https://router.wikeyun.cn/api/oauth/taobao?redirect_uri=". urlencode($callBackUrl);
        return $urls;
    }

    public function getAppKeyName(): string
    {
        return 'tb_app_key';
    }

    public function getAppSecretName(): string
    {
        return 'tb_app_secret';
    }
}